#ifndef _DUBAOTHOITIETFORM_H_
#define _DUBAOTHOITIETFORM_H_

#include <FBase.h>
#include <FUi.h>
#include<FGraphics.h>
#include <FMedia.h>
#include "FormManager.h"
#include"WeatherForm.h"
class WeatherInfoForm: public Osp::Ui::Controls::Form,
		public Osp::Ui::IActionEventListener,
		public Osp::Ui::IExpandableItemEventListener {

	// Construction
public:
	WeatherInfoForm(void);
	virtual ~WeatherInfoForm(void);
	bool Initialize();
	result OnInitializing(void);
	result OnTerminating(void);
	// Implementation
protected:
	const static int ID_SOFTKEY_BACK = 1036;
	// Generated call-back functions
	//Osp::Ui::Controls::Frame*pFrame;
	//Osp::Ui::Controls::Form *pFormParent;
	Osp::Graphics::Canvas* pCanvas;

public:
	//void SetParentForm(Osp::Ui::Controls::Form*pParent);
	//void SetFrame(Osp::Ui::Controls::Frame*pFrame);

public:

	void OnActionPerformed(const Osp::Ui::Control&, int);
public:

	virtual void OnItemStateChanged(const Osp::Ui::Control &source,
			int mainIndex, int subIndex, int itemId, int elementId,
			Osp::Ui::ItemStatus status);
	virtual void
	OnItemStateChanged(const Osp::Ui::Control &source, int mainIndex,
			int subIndex, int itemId, Osp::Ui::ItemStatus status);
protected:
	static const int ID_LIST_MAINITEM = 101;
	static const int ID_LIST_SUBITEM = 102;
	static const int ID_LIST_TEXT = 103;
	static const int ID_LIST_BITMAP = 104;
	static int FormId;
	Osp::Graphics::Bitmap* GetBitmapN(const Osp::Base::String& name);

	result AddListMainItem(Osp::Ui::Controls::ExpandableList& expandableList,
			Osp::Base::String itemText, Osp::Graphics::Bitmap* pBitmapNormal,
			Osp::Graphics::Bitmap* pBitmapFocused);

	result AddListSubItem(int indexMain,
			Osp::Ui::Controls::ExpandableList& expandableList, int itemId,
			Osp::Base::String itemText);

private:
	Osp::Ui::Controls::ExpandableList *pExpandablelist;
	Osp::Ui::Controls::CustomListItemFormat* __pMainItemFormat;
	Osp::Ui::Controls::CustomListItemFormat* __pSubItemFormat;

public:
	void SetFormId(int id){
		this->FormId = id;
	}
	static int GetFormId(){
		return FormId;
	}
	void LoadDuLieuVaoExpandableList(Osp::Ui::Controls::ExpandableList*);
	void DisplayCurrentWeather();
	void DisplayCurrentWeatherAndForecast();
};

#endif
